<?php
require_once (C_PATH.'/utility.php');

class error_page extends spController
{
    var $tUsers;
    var $arrErrMsg;

    /**
     * unit_super::__construct()
     * 
     * @return
     */
    public function __construct()
    {
        parent::__construct();
        whoAmI($this);  //check the permission
        
        //初始化模型类
        $this->tUsers = spClass('users');
        
        //错误讯息数组
        $this->arrErrMsg = array(
            '您无权浏览该页面，请尝试<a style="color: green; text-decoration: underline;" href="'.spUrl('main', 'logout').'">重新登录</a>',  //errno=0
            '您已经登录过，请先进行，请<a style="color: green; text-decoration: underline;" href="'.spUrl('main', 'logout').'">安全登出</a>',  //errno=1
            '系统检测到用户帐号出现异常，请<a style="color: green; text-decoration: underline;" href="'.spUrl('main', 'logout').'">登出</a>后重新登录重新登录'  //errno=2
        );

    }

    /**
     * unit_super::index()
     * 
     * @return
     */
    function index()
    {
        $errno = $this->spArgs('errno');
        $this->errno = $errno;
        $this->errmsg = $this->arrErrMsg[$errno];    
        $this->display('error.html');
    }
}

